<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/store/include/init_store.jsp" %>
<%

	if (!isSeller) {
		response.sendRedirect("/");
		return ;
	}

	
	String s_book_name	= StringUtil.nvl(request.getParameter("s_book_name"));
	
	HashMap infos = new HashMap();
	infos.put("publisher_id", session_user_id);
	infos.put("book_name", s_book_name);
	
	PublisherDAO dao = new PublisherDAO();
	HashList list 	= dao.selectBookList(infos);
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= HOME_NAME %></title>
	<%@ include file="/home/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#store_main li:nth-child(2)').addClass('on');
	});
	
	function fnSubmit() {
		document.searchForm.submit();
	}

	</script>
</head>
<body>
	<div id="wrap">
		<%@ include file="/publisher/include/header.jsp"  %>
		
		<div id="contents">
			<h2>큐북관리</h2>
			<form name="searchForm" id="searchForm" method="post" action="./bookList.jsp">

			<table cellpadding="0" cellspacing="0" class="table_01 mt15">
			<colgroup>
				<col width="100px" />
				<col  />
			</colgroup>
			<tr>
			    <th><p>큐북명</p></th>
			    <td class="brx"><input type="text" name="s_book_name" id="s_book_name" value="<%= s_book_name %>" class="w120"/></td>
			</tr>
			</table>
	
			<div class="mt10 mb10 r">
				<!--<input type="image" class="button" src="./images/btn_search.gif"/>
				 <a href="./bookDetail.jsp"><img src="./images/btn_new.gif"/></a> -->
				<a href="#nohref" onclick="fnSubmit()"><img src="./images/btn_search.gif"/></a>
				<a href="./bookDetail.jsp" ><img src="./images/btn_new.gif"/></a>
			</div>

			</form>

			<div class="search_result">검색결과 : <%=list.size() %>건</div>
	
			<table cellpadding="0" cellspacing="0" class="table_01">
				<colgroup>
					<col width="100px"/>
					<col/>
					<col width="90px"/>
					<col width="120px"/>
					<col width="70px"/>
					<col width="70px"/>
					<col width="80px"/>
				</colgroup>
				<thead>
					<tr>
						<th><p>큐북코드</p></th>
						<th><p>큐북명</p></th>
						<th><p>출판일</p></th>
						<th><p>서비스기간</p></th>
						<th><p>판매수</p></th>
						<th><p>리뷰</p></th>
						<th><p>상태</p></th>
					</tr>
				</thead>
				<tbody id="list">
				<%	for (int i = 0; i < list.size(); i++) { %>
					<tr>
						<td><a href="./bookDetail.jsp?book_code=<%= list.get("book_code",i) %>"><%= list.get("book_code",i) %></a></td>
						<td><%= list.get("book_name",i) %></td>
						<td class="c"><%= list.getDate("publish_dt",i) %></td>
						<td class="r"><%= list.get("start_dt",i) %> ~ <%= list.get("end_dt",i) %></td>
						<td class="r"><%= list.get("sales_count",i) %></td>
						<td class="r"><%= list.get("review_count",i) %></td>
						<td class="c"><%= list.get("sales_status",i) %></td>
					</tr>
				<%	} %>
				<%	if (list.size() == 0) { %>
					<tr>
						<td class="no_result" colspan="7">검색된 결과가 없습니다.</td>
					</tr>
				<%	} %>
				</tbody>
			</table>
			
             
		</div>
		
		<%@ include file="/publisher/include/footer.jsp"  %>		
	</div>

</body>



</html>
